#ifndef KMYMAP_H
#define KMYMAP_H

#include "../KmyStructDef.h"
#include "KmyWorldComponent.h"
#include "KmySprite.h"
#include "../KmyVector.h"

class KmyMap : public KmyWorldComponent
{
public:
    KmyMap();
    KmyMap(int w, int h);
    virtual ~KmyMap();

    void finalize();

    int getNodeType();
    void addSprite(KmySprite* spt);
    void removeSprite(KmySprite* spt);

    void logic(St_Rect *camera);
    void render(KmyICanvas *screen);
//    void render(KmyICanvas *screen, St_Rect *camera);

    bool isSpriteInCamera(KmySprite* spt, St_Rect *camera);

    float move_ratio_x; //相对世界移动的比率
    float move_ratio_y;

    int getMapWidth();
    int getMapHeight();

    int getGlobalX();
    int getGlobalY();
private:
    int map_W;
    int map_H;

//    KmyVector sprites;
};

#endif // KMYMAP_H
